﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SmallERP.PinBan.PB.Presenter;
using SmallERP.Bll.PinBan;

namespace SmallERP.PinBan.PB.Froms
{
    public partial class FrmSelectedPrinter : Form
    {
        public FrmSelectedPrinter()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataTransfer.CurPrinerInfo = DataTransfer.AllPrinterList.FirstOrDefault(p => p.PrinterID == (int)comboBox1.SelectedValue);
            ////同时需要列新模板列表
            //DataTransfer.BoardTempalteList = BoardTemplateBLL.GetAllTemplate(DataTransfer.CurPrinerInfo);
            this.DialogResult = DialogResult.OK;
        }

        private void FrmSelectedPrinter_Load(object sender, EventArgs e)
        {
            comboBox1.DataSource = DataTransfer.AllPrinterList;
            comboBox1.DisplayMember = "PName";
            comboBox1.ValueMember = "PrinterID";
        }

        private void FrmSelectedPrinter_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (this.DialogResult != DialogResult.OK)
            {
                if (MessageBox.Show("是否要退出拼板？", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    e.Cancel = true;
                }
            }
        }
    }
}
